$('.btu-add').on('click', function () {
   // console.log(123);
   let data = $('.user-add').serialize();

   // 手机号
   let phone = $('.phones').val();
   let phone1 = /^1(3|4|5|7|8)\d{9}$/.test(phone);
   // console.log(phone);
   // 密码
   let pass = $('.passs').val();
   let pass1 = /^[A-Za-z0-9]{6,16}$/.test(pass);
   // console.log(pass);
   // 姓名
   let xingm = $('.xingm').val();
   let xingm1 = /^[\u4e00-\u9fa5]+(·[\u4e00-\u9fa5]+)*$/.test(xingm);
   // 公司名称
   let gonhshi = $('.mingc').val();
   let gonhshi1 = /^[A-Za-z0-9_()（）\-\u4e00-\u9fa5]+$/.test(gonhshi);
   if (!phone1 == '' && !pass1 == ''&& !pass1 == '' && !xingm1 == ''&& !gonhshi1 == ''? true:alert('您输入的内容不能为空！') ){
      alert('注册成功！');
   }!phone1 ? $('.gao1').show() : $('.gao1').hide();
   !pass1 ? $('.passss').show() : $('.passss').hide();
   !xingm1 ? $('.name1').show() : $('.name1').hide();
   !gonhshi1 ? $('.shi').show() : $('.shi').hide();
   // let hh=$('form ).val()
   // console.log($('form input).val());
   // if ()
    if(phone1 != '' && pass1 != '' && gonhshi1 != ''&& xingm1 != '')  {
      $.ajax({
      type: 'post',
      url: '/userAdd',
      data: data,
      success: function (data) {
         // console.log(data);
         if (data.code == '1200') {
            alert(data.message);
            location.href = '/gy_login';
         }
      }
   })
    }
   
})